import React from 'react';
import { View, TextInput } from 'react-native';
import PropTypes from 'prop-types';
import List from './components/List';

const CompleteView = ({
    navigation, compList, getPlanList, setSearchVal, searchVal,
}) => (
    <View>
        <TextInput
            style={{
                height: 45,
                borderWidth: 2,
                color: '#0079FF',
                fontSize: 18,
                borderRadius: 5,
                borderColor: '#9CDCFE',
            }}
            onChangeText={text => setSearchVal(text)}
            value={searchVal}
            placeholder="搜索标题"
        />
        <List navigation={navigation} compList={compList} getPlanList={getPlanList} />
    </View>
);
CompleteView.defaultProps = {
    compList: [],
    getPlanList: () => {},
    setSearchVal: () => {},
    searchVal: '',
};
CompleteView.propTypes = {
    compList: PropTypes.arrayOf(PropTypes.any),
    getPlanList: PropTypes.func,
    setSearchVal: PropTypes.func,
    searchVal: '',
};
export default CompleteView;
